UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kDpTXDf3UJ/KJ/qPYdzOzsTSHyrcDMICtOQDdiu1Avs='
WHERE
key_id = 'c97be77fd7c8a429234ae1bb42b6e5e39a09ff6ec6d4bbaa4ede9ec164de9c5b'
AND (
token = 'kDpTXDf3UJ/KJ/qPYdzOzsTSHyrcDMICtOQDdiu1Avs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)