UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2JCi85SEYp8wmhIyKD78XkzZDsN9kp499KnHPBoSEUw='
WHERE
key_id = '5f8a4722d97059eb7c0c19193d3bfe570194ee4fffd463a05e368e46a68aab83'
AND (
token = '2JCi85SEYp8wmhIyKD78XkzZDsN9kp499KnHPBoSEUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)