UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jAq2MakRfzlS+2yh8yeBnsDAY+5z5Vz8bQ0zoV+/N4w='
WHERE
key_id = 'e6496a864c378a822c9fcc08f7dc758b001641fecd21f010b01457a4628b0bf5'
AND (
token = 'jAq2MakRfzlS+2yh8yeBnsDAY+5z5Vz8bQ0zoV+/N4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)