UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '526e7LwZreuhls0gtqOuY+9QyFDQadN8wyqWEDYYZxQ=' 
WHERE 
  key_id = '0b2cbdb3a0854548b9411d3c0d7bb4a80766c41b14200b7f8e4afd21ad6f6c68' 
  AND (
    token = '526e7LwZreuhls0gtqOuY+9QyFDQadN8wyqWEDYYZxQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049