UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'phg6iZpRPa8kQr1fWPRUs21a/cbRjlFAfCAeKCIp1U4='
WHERE
key_id = '98613366d5790f9cd6f5f1e90887ff1d49d02579b553c935e7a75d9a01f5d652'
AND (
token = 'phg6iZpRPa8kQr1fWPRUs21a/cbRjlFAfCAeKCIp1U4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)