UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UELMvWi8bVzCknIlLe0kBxdIB+1mbi/qk1zdOYiH8b4='
WHERE
key_id = '92bbca806d82867c0d9815c7a3a505f73873d5ceb0e2fb4f4b026adda6400a91'
AND (
token = 'UELMvWi8bVzCknIlLe0kBxdIB+1mbi/qk1zdOYiH8b4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)