UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hz6CxcQ4yHItdIjonUASOVRiQxw713rW1LlKR0gmNvU='
WHERE
key_id = '2673cecb588d6618c4fd8f286d6c4b7ab124150197b37071c3e0c1d0207f202b'
AND (
token = 'Hz6CxcQ4yHItdIjonUASOVRiQxw713rW1LlKR0gmNvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)