UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dcz4nts4/ea0SlQlZ7ropUOwwC9g28+UDPfexZ91i5U='
WHERE
key_id = '6c1109961c74bdbf60b9a8d725164b2eda5c447803285ccffb675b867c8ecaef'
AND (
token = 'dcz4nts4/ea0SlQlZ7ropUOwwC9g28+UDPfexZ91i5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)