UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YruqmJhtIBhFVHo63aopHm19XRdHJh/OdNRER3XLhhc='
WHERE
key_id = '02ee0e1d11511fd22a4d81c9ba3e1c766a0a33e07e45baafc64f268d977d558f'
AND (
token = 'YruqmJhtIBhFVHo63aopHm19XRdHJh/OdNRER3XLhhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)