UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HGV3An2WZUEAjzqsWgQ9Fb+RsRakWkoF2uV3QE0xecc='
WHERE
key_id = 'b3b6c85b081c87ca474081ff80243217acac46ba8e7d71d45164cf548519aac5'
AND (
token = 'HGV3An2WZUEAjzqsWgQ9Fb+RsRakWkoF2uV3QE0xecc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)