UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fCfXO8GEevgUgoPeGfuMB4Vqrey26dBhbrGA0X6SOQQ='
WHERE
key_id = '5bb6975e806b40550edb9b3e05fa949597d5a4e1a4b44206bc7ae39b39e6a489'
AND (
token = 'fCfXO8GEevgUgoPeGfuMB4Vqrey26dBhbrGA0X6SOQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)