UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JbsTmIfljEdJWDSGxNKijigNCBM/7f8lS4UpekOvPtQ=' 
WHERE 
  key_id = '20ccf519de41858df67e64f53ce5f5e2f2783bc442209a89e2c3e2261e1bf417' 
  AND (
    token = 'JbsTmIfljEdJWDSGxNKijigNCBM/7f8lS4UpekOvPtQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030