UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0utZCcLMdt5k4lfhw68/b6BfGxttUP1cdsX0Mypr9tw='
WHERE
key_id = 'a9c82d89e66f5d8ea95316dfa4400d5df175ed0143c770a405821867cfa63ff3'
AND (
token = '0utZCcLMdt5k4lfhw68/b6BfGxttUP1cdsX0Mypr9tw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)