UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JjdmIYgtsofteOXevC02PysFjwnon+EnYqh11PxNaFw=' 
WHERE 
  key_id = '975e625ac54ad869be5381e1b8dce9d67641e3bc68225ac05f12c4cc6a32006b' 
  AND (
    token = 'JjdmIYgtsofteOXevC02PysFjwnon+EnYqh11PxNaFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043