UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'StWnCERhtATfOOKzwwaNB+t6vNJFzTlYX9+ohwtpl6g='
WHERE
key_id = '45a146f53621bd0d58fc28e44548fd2fec37a35ec3fe1579db1b44bd906ceb72'
AND (
token = 'StWnCERhtATfOOKzwwaNB+t6vNJFzTlYX9+ohwtpl6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)