UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PxEqhi/A1PTrVJrEUyUWw+ceW2Dn0dUli3PPuGrQTz8=' 
WHERE 
  key_id = '4e5cbb0f388b818044f5a9995143ec0aab83b87bb9088dde9f3892c4d4099b68' 
  AND (
    token = 'PxEqhi/A1PTrVJrEUyUWw+ceW2Dn0dUli3PPuGrQTz8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047