UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B0a2nc1ctW/nslbs+wIgcmgZVhdFPDPp6tpC1ZlVAcg=' 
WHERE 
  key_id = '94b0c63073046454f76c3687585ef5f2d22d4c512047622c0afc22f7cd921e3f' 
  AND (
    token = 'B0a2nc1ctW/nslbs+wIgcmgZVhdFPDPp6tpC1ZlVAcg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035