UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CzgOwGuU73ocajqU7y4azjDpfZRg85iar9uL+CQtomU='
WHERE
key_id = '6fbfee21bae3793beb7e7cb8bd02dfcd1d4d1d277f6379ebc7e9faf9e2a4f99c'
AND (
token = 'CzgOwGuU73ocajqU7y4azjDpfZRg85iar9uL+CQtomU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)