UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FSBWXi5edEzoVARFlahgWIX575RDOfk9OoKLi5ljqoQ='
WHERE
key_id = '38c08b9d0ce6b494b2d0b704a306440c0df0112feceb2718b71d3fbc5a2d2ca5'
AND (
token = 'FSBWXi5edEzoVARFlahgWIX575RDOfk9OoKLi5ljqoQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)