UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sNmHdJJiIe9YJIUxTdLMvHBRAocHzprJWMf5I6GFlB4='
WHERE
key_id = '7ce11acb2a5f971dce1ba50dd4592756ba051a53be536bd3e39fa646e1d567e8'
AND (
token = 'sNmHdJJiIe9YJIUxTdLMvHBRAocHzprJWMf5I6GFlB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)