UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f5Lbxhtqsu/ESveDh+oqRbQRFILN2vYWGXHmiDt9GmE='
WHERE
key_id = 'e209f8b5ff23754af3b014ccfd810e65ab445fe221a75fda587d37f5ab4ed45d'
AND (
token = 'f5Lbxhtqsu/ESveDh+oqRbQRFILN2vYWGXHmiDt9GmE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)