UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sxNBYTM2zKeF6HmLxbFm5+FdVQuRqE62JnZ5GTTxGXM='
WHERE
key_id = 'cc418710f43276d3e4444a465e8ac200d622c6de6e37180c8e0d0ceaf781820f'
AND (
token = 'sxNBYTM2zKeF6HmLxbFm5+FdVQuRqE62JnZ5GTTxGXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)