UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FVGTy4X4LG1J68CkKoE7rrBDv1IyRwkDXpdaMdTcE7Y=' 
WHERE 
  key_id = '25e1260010e902540167b49268a8788faf39a319866ed0dda0cf23f262630328' 
  AND (
    token = 'FVGTy4X4LG1J68CkKoE7rrBDv1IyRwkDXpdaMdTcE7Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035