UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a7UYtvJgGq5D7DTnoCjinaLZ6vJ0v/q1BhRxdfjfhxk='
WHERE
key_id = '35cd68e41cfc51ffa6252aa52ccbca61842dd2e430c36e207993bd2bde832c3a'
AND (
token = 'a7UYtvJgGq5D7DTnoCjinaLZ6vJ0v/q1BhRxdfjfhxk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)