UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lixqyJBYxhOTbbQxhNuY4AMNDJ4SS3WQDTSJKi1cFLA='
WHERE
key_id = '1efd5c2a44a96c74c49c6926e4afe2c23d3facbecad95efeca6c12357a493ffa'
AND (
token = 'lixqyJBYxhOTbbQxhNuY4AMNDJ4SS3WQDTSJKi1cFLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)