UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FGe7sJmpDPIGN+vvL1Jv/+87XGv8m5WBFtlEEpNzOsA='
WHERE
key_id = 'f63f6f93b8aa9a6ee57d71136b571b1afd14da302a9a4f4134b22e4d2b714010'
AND (
token = 'FGe7sJmpDPIGN+vvL1Jv/+87XGv8m5WBFtlEEpNzOsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)