UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gcVxGLE/EcAiGsG2K02/ZIpz7C63tk2AldSIyWBcyw0='
WHERE
key_id = 'b9524d3c678fb74a3468e1f2f086625ddd78f13917ffcbe02bc3344aa76bcad7'
AND (
token = 'gcVxGLE/EcAiGsG2K02/ZIpz7C63tk2AldSIyWBcyw0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)