UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BlKuSZPHu3d36DlZzXYdp4e7o1QQwkcuTUrcSIKdUxQ='
WHERE
key_id = '4e4f3733262e88507f91d52bf136cd15e6fe90050ec011bcaba62422b6113718'
AND (
token = 'BlKuSZPHu3d36DlZzXYdp4e7o1QQwkcuTUrcSIKdUxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)