UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '74haqnzwdtDobfc0/0/oJEYfeDk+F2fmh0hynOadrhY='
WHERE
key_id = 'dea40598b0418657362559fc1a06da07607c6632c6fb04aeacaa60e16ee68fdb'
AND (
token = '74haqnzwdtDobfc0/0/oJEYfeDk+F2fmh0hynOadrhY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)