UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd0nbQh1MErPoJJZSSqXuAgX/k1bZz/yEkL2OU8O77rs='
WHERE
key_id = '71982ad5f0126dad5e203c7158cd2f71ba52337fb8536d2aeebfb60d657ab77b'
AND (
token = 'd0nbQh1MErPoJJZSSqXuAgX/k1bZz/yEkL2OU8O77rs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)