UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QNLkCngjwBwF0ev+AFI6A6YZgy+KiQwWbqq0/pX53mg='
WHERE
key_id = '2c5a096253cb0ad348bf27151b290647434a4f8f6999e375e0812eafa7426cd7'
AND (
token = 'QNLkCngjwBwF0ev+AFI6A6YZgy+KiQwWbqq0/pX53mg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)