UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HCiENFKf+19bu9r3M3hEqVAqGHBq5YKSN3fapHyhi4E='
WHERE
key_id = '162617dcc6c9fd984da97ac68e3c693f177ae6c2bf74a7904244805926943baf'
AND (
token = 'HCiENFKf+19bu9r3M3hEqVAqGHBq5YKSN3fapHyhi4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)