UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aAgc6gnBcTikJDOjb+B2LFjlh68lqwaSIS0VmJNc9KY='
WHERE
key_id = '98535e1e68960780955ea4fc84c5a185566fb000493d4a497964584022cdcaba'
AND (
token = 'aAgc6gnBcTikJDOjb+B2LFjlh68lqwaSIS0VmJNc9KY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)