UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mcob0UXIqaXY7QNCWkXGIxXCx+Um2lU4Juc8QPshYks='
WHERE
key_id = '6d9ba404d4e38d11223f9e6949e9ca4eb13041d4022528d818a5e5792b19c432'
AND (
token = 'mcob0UXIqaXY7QNCWkXGIxXCx+Um2lU4Juc8QPshYks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)