UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PxLEYaC6+Ld2Psgfz66ji3GR4hOFPHLWxSOTpsmeVUo=' 
WHERE 
  key_id = '3aa1e6f15f9eefc2c825cf855fccee0efd3f63710a9282f1b5c9c0a3221327ed' 
  AND (
    token = 'PxLEYaC6+Ld2Psgfz66ji3GR4hOFPHLWxSOTpsmeVUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025